#include"com.h"
int main()
{
  int fd=open(FILE_NAME,O_WRONLY); 
  if(fd<0)
  {
    printf("open error\n");
    return 1;
  }
  char s[100];
  while(1)
  {
    s[0]=0;
    printf("请输入：");
   fflush(stdout);
    ssize_t n= read(0,s,sizeof(s));
   if(n>0)
   {
     s[n-1]=0;//把反斜杠n设为反斜杠0
     write(fd,s,strlen(s));
   }
  }
  close(fd);
  return 0;
}

